package org.example.service.impl;

import org.example.service.ShutTaskService;
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.concurrent.CountDownLatch;

/**
 * @Author: WangShengJie
 * @Date: 2025/8/6
 */
@Service
public class ShutTaskServiceImpl implements ShutTaskService {

    @Resource(name = "threadPoolExecutor")
    ThreadPoolTaskExecutor taskExecutor;

    public static CountDownLatch countDownLatch;
    @Override
    public void shutDownTest() throws InterruptedException {

//        System.out.println("开始");
//        Thread.sleep(10000);
//        taskExecutor.execute(new Runnable() {
//            @Override
//            public void run() {
//                System.out.println("shutdown************");
//
//            }
//        });
//        taskExecutor.shutdown();
//        System.out.println("结束");

        String str = "apple,banan,ajfkiaj,";
        str = str.substring(0, str.length() - 1);
        System.out.println(str);

    }
}
